package com.hopu.v1.service.front.attendance.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hopu.v1.pojo.classes.attendance.Attendance;
import com.hopu.v1.service.front.attendance.FAttendanceService;
import com.hopu.v1.mapper.front.attendance.FAttendanceMapper;
import com.hopu.v1.utils.JwtUtils;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author lihao
* @description 针对表【t_attendance(学生考勤表)】的数据库操作Service实现
* @createDate 2024-10-11 14:27:30
*/
@Service
public class FAttendanceServiceImpl extends ServiceImpl<FAttendanceMapper, Attendance>
    implements FAttendanceService {

    @Autowired
    private FAttendanceMapper fAttendanceMapper;

    /**
     * 查询学生的考勤记录
     * @param studentId
     * @return
     */
    @Override
    public List<Attendance> selectStudentAttendance(String studentId) {
        System.out.println(studentId);
        return fAttendanceMapper.selectStudent(studentId);
    }

    /**
     * 新增&更新
     * @param attendance
     */
    @Override
    public void add(Attendance attendance) {
        System.out.println(attendance.getAttendanceStatus());
        saveOrUpdate(attendance);
    }
}




